home *** CD-ROM | disk | FTP | other *** search
- #include "colors.inc"
- #include "textures.inc"
- #include "shapes.inc"
- #include "color.inc"
-
- #global_settings {
- assumed_gamma 2.2
- }
-
- // Hand adapted from Alfonso Hermida's "Adventures in Ray Tracing"
- //===============================================================
- #declare FingerAnglex123 = -30
- #declare FingerAnglex23 = -30
- #declare FingerAnglex3 = -30
-
- #declare ThumbAngley = -10
- #declare ThumbAnglez = 75
- #declare ThumbAngle2x = 0
-
- #declare Finger_Diam = 0.3
- #declare Finger_Section_Len = 0.4
- #declare FG = 0.15
-
- #declare Palm = union {
- box { <-1, -1, -1>, <1, 1, 1> }
- cylinder { <-1, 1, 0> <1, 1, 0>, 0.25 scale <1, 1, 4> }
- scale <1.35, 1.5, 0.3>
- }
- #declare Knuckle = object { sphere {<0,0,0>,1.0}
- scale <Finger_Diam, Finger_Diam, Finger_Diam>
- translate -y*Finger_Section_Len
- }
- #declare Finger_Section = cylinder { <0,-1,0>, <0,1,0>, 1
- scale <Finger_Diam, Finger_Section_Len, Finger_Diam>
- }
- #declare Finger_With_Knuckle = union {
- object { Finger_Section }
- object { Knuckle }
- }
- #declare Finger_Lower_Section = object {
- Finger_With_Knuckle
- }
- #declare Finger_Mid_Section = object {
- Finger_With_Knuckle
- }
- #declare Finger_Tip_Section = union {
- object { Finger_With_Knuckle }
- object { Knuckle translate y*Finger_Section_Len*2 } // Finger tip
- }
-
- #declare Thumb = union {
- object { Finger_Tip_Section } // Connected to hand
- object { Finger_Tip_Section // Tip
- translate y * Finger_Section_Len
- rotate x * ThumbAngle2x
- translate y * Finger_Section_Len * 2
- }
- rotate z * ThumbAnglez
- rotate y * ThumbAngley
- translate -x * 1.75
- }
-
- #declare Finger = union {
- object {
- Finger_Lower_Section
- translate y * Finger_Section_Len
- }
- union {
- object { Finger_Mid_Section
- translate y * Finger_Section_Len
- }
- object { Finger_Tip_Section
- translate y * Finger_Section_Len
- rotate x * FingerAnglex3
- translate y * Finger_Section_Len * 2
- }
- rotate x * FingerAnglex23
- translate y * Finger_Section_Len * 2
- }
- rotate x * FingerAnglex123
- }
-
- #declare Finger1 = object {
- Finger
- scale <0.9, 0.8, 1>
- translate <2*(Finger_Diam+(2*FG)), 1.75, 0>
- }
- #declare Finger2 = object {
- Finger
- scale <0.9, 1.0, 1>
- translate <Finger_Diam+FG, 1.75, 0>
- }
- #declare Finger3 = object {
- Finger
- scale <0.9, 0.9, 1>
- translate <-(Finger_Diam+FG), 1.75, 0>
- }
- #declare Finger4 = object {
- Finger
- scale <0.9, 0.75, 1>
- translate <-2*(Finger_Diam+(2*FG)), 1.75, 0>
- }
-
- #declare Hand = union {
- object { Palm }
- object { Thumb }
- object { Finger1 }
- object { Finger2 }
- object { Finger3 }
- object { Finger4 }
- texture {
- Silver1
- finish { reflection 0 }
- }
- }
-
- // The axis bar and rotation pointer definitions
- //=======================================================================
-
- // The axis bar
- //-------------
- #declare Axis_Bar = union {
- object { Disk_X scale <6, 1, 1> }
- object { Cone_X scale <1, 1.5, 1.5> translate x * 7 }
- texture {
- Silver1
- pigment { Red }
- finish { reflection 0 }
- }
- scale <1, 0.35, 0.35>
- translate <-4, 0.35, 1.65>
- }
-
- // Rotation Pointer
- //----------------
- #declare Cone = cone { <0,0,0>, 0 <0,0,1>, 1
- scale <0.05, 0.05, 0.15>
- rotate <90, 0, 0>
- translate <0.3, 0.15, 0>
- }
-
- #declare Torus = torus {
- 0.30, 0.015 sturm
- rotate -x*90
- }
-
- #declare Cube = box { <-1, -1, -1>, <1, 1, 1>
- scale <0.2, 0.2, 0.2>
- translate <0.2, 0.2, 0>
- inverse
- }
-
- #declare Torus_Segment = object { Torus
- clipped_by { object { Cube } }
- }
-
- #declare Rotation_Pointer = union {
- object { Cone }
- object { Torus_Segment }
- texture { Silver1
- pigment { Yellow }
- finish { reflection 0 }
- }
- scale 7
- rotate <190, -90, 0>
- rotate -x*120
- translate <-4.0, 0.35, 1.65>
- }
-
-
- //=====================================================================
- camera {
- location <4, 5, -6>
- direction z*1.45
- right x*4/3
- look_at <0.5, 1.5, 0>
- }
-
- light_source { <10, 10, -10> color White }
- light_source { <-100, 100, -100> color LightSteelBlue }
-
- object { Hand rotate y*180}
- union {
- object { Axis_Bar }
- object { Rotation_Pointer }
- translate z*0.2
- }
-
-